From 880a38ef92a5cc5d898047590766f3404699a100 Mon Sep 17 00:00:00 2001 From: Justin Burkett Date: Wed, 30 Nov 2016 07:03:52 -0500 Subject: [PATCH] Fix bug in last commit The regexp-quote docstring is misleading since (regexp-quote "SPC x") will match "SPC x c". Added back the beginning and end markers in the regexp. --- which-key.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/which-key.el b/which-key.el index 7d99fa597a3..d383866b7d6 100644 --- a/which-key.el +++ b/which-key.el @@ -810,7 +810,7 @@ replacements are added to (while key-sequence ;; normalize key sequences before adding (let ((key-seq (key-description (kbd key-sequence)))) - (push (cons (cons (regexp-quote key-seq) nil) + (push (cons (cons (concat "\\`" (regexp-quote key-seq) "\\'") nil) (cons nil (or (car-safe replacement) replacement))) which-key-replacement-alist) (when (consp replacement) @@ -836,7 +836,7 @@ addition KEY-SEQUENCE REPLACEMENT pairs) to apply." (while key-sequence ;; normalize key sequences before adding (let ((key-seq (key-description (kbd key-sequence)))) - (push (cons (cons (regexp-quote key-seq) nil) + (push (cons (cons (concat "\\`" (regexp-quote key-seq) "\\'") nil) (cons nil (or (car-safe replacement) replacement))) mode-alist) (when (consp replacement) -- 2.30.2